package top.ed333.mcplugins.configurableevents.requirement;

import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerEvent;
import org.jetbrains.annotations.NotNull;

public class PlayerHasPermissionReqGroup extends TargetedByPlayerEventReqGroup {
    public PlayerHasPermissionReqGroup(String groupName, @NotNull String ext) {
        super(groupName, ext);
    }

    @Override
    public boolean checkReq(@NotNull PlayerEvent event) {
        Player player = event.getPlayer();
        return player.hasPermission(getExt().toString());
    }

    @Override
    public String name() {
        return "PlayerHasPermission";
    }
}
